import request from '@/utils/request';

export async function query() {
  return request('/api/users');
}
export async function queryCurrent(params) {
  return request('/api/member/api-member/member/getUserInfo', {
    showToast: false,
  });
}
export async function queryNotices() {
  return request('/api/notices');
}

export async function login(params) {
  return request(`/api/member/api-member/member/login?code=${encodeURIComponent(decodeURIComponent(params))}`, {
    method: 'get',
  }).catch(() => {

  });
}

export async function getFakeCaptcha(mobile) {
  return request(`/api/login/captcha?mobile=${mobile}`);
}

export async function logout() {
  return request('/api/member/api-member/member/exit');
}

export async function updatePwdByOldPwd(params) {
  return request('/api/member/api-member/member/updatePwdByOldPwd', {
    method: 'POST',
    data: {
      ...params
    },
    requestType: 'form'
  }).then((res) => {
    return res;
  });
}

export async function getProfessionstyle() {
  return request(`/api/member/api-member/newEmployees/getProfessionstyle`, {
    method: 'get'
  }).then((res) => {
    return res.data;
  });
}
